<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja">
  <head>
    <title>A canvas remove fallback content example</title>

    <script type="text/xaml" id="xaml"><?xml version="1.0"?>
      <Canvas xmlns="http://schemas.microsoft.com/client/2007"></Canvas></script>
<!--
<script type="text/javascript" src="../uupaa-excanvas.js"></script>
 -->

    <script>
      function boot() {
        var scr     = document.createElement("script");
        scr.type    = "text/javascript";
        scr.charset = "utf-8";

        if (document.uniqueID) {
          scr.onreadystatechange = function() {
            if (/loaded|complete/.test(this.readyState)) {
              uuCanvas.ready(function() {
                drawShape(document.getElementById('canvas'));
                drawShape(document.getElementById('vmlcanvas'));
              });
            }
          };
        } else {
          scr.onload = function() {
            uuCanvas.ready(function() {
              drawShape(document.getElementById('canvas'));
              drawShape(document.getElementById('vmlcanvas'));
            });
          };
        }

        scr.setAttribute("src", "../uupaa-excanvas.js");
        document.getElementsByTagName("head")[0].appendChild(scr);
      }

      function drawShape(canvas) {
        if (canvas.getContext) {

          // use getContext to use the canvas for drawing
          var ctx = canvas.getContext('2d');

          // Draw shapes
          ctx.fillRect(25,25,100,100);
          ctx.clearRect(45,45,60,60);
          ctx.strokeRect(50,50,50,50);

        } else {
          alert('You need Safari or Firefox 1.5+ to see this demo.');
        }
      }
    </script>
    <style type="text/css">
      body { margin: 20px; font-family: arial,verdana,helvetica; background: #fff;}
      h1 { font-size: 140%; font-weight:normal; color: #036; border-bottom: 1px solid #ccc; }
      canvas { border: 2px solid #000; float: left; margin-right: 20px; margin-bottom: 20px; }
      pre { float:left; display:block; background: rgb(238,238,238); border: 1px dashed #666; padding: 15px 20px; margin: 0 0 10px 0; }
    </style>
  </head>

  <body>
    <h1>canvas <code>remove fallback content</code> example</h1>
    <div>
      <canvas id="canvas" width="150" height="150"><p style="border: 1px solid red">fallback text</p></canvas>
      <canvas id="vmlcanvas" class="vml" width="150" height="150">fallback image<br /><img src="images/rhino.jpg" alt="alt image" /></canvas>
      <br />
      <input type="button" value="load library" onclick="boot()" />
<pre>
&lt;script type="text/xaml" id="xaml"&gt;&lt;?xml version="1.0"?&gt;
  &lt;Canvas xmlns="http://schemas.microsoft.com/client/2007"&gt;&lt;/Canvas&gt;&lt;/script&gt;
&lt;!--
&lt;script type="text/javascript" src="../uupaa-excanvas.js"&gt;&lt;/script&gt;
--&gt;

&lt;canvas id="canvas" width="150" height="150"&gt;&lt;p style="border: 1px solid red"&gt;fallback text&lt;/p&gt;&lt;/canvas&gt;
&lt;canvas id="vmlcanvas" class="vml" width="150" height="150"&gt;fallback image&lt;br /&gt;&lt;img src="images/rhino.jpg" alt="alt image" /&gt;&lt;/canvas&gt;
&lt;br /&gt;
&lt;input type="button" value="load library" onclick="boot()" /&gt;

function boot() {
  var scr     = document.createElement("script");
  scr.type    = "text/javascript";
  scr.charset = "utf-8";

  if (document.uniqueID) {
    scr.onreadystatechange = function() {
      if (/loaded|complete/.test(this.readyState)) {
        uuCanvas.ready(function() {
          drawShape(document.getElementById('canvas'));
          drawShape(document.getElementById('vmlcanvas'));
        });
      }
    };
  } else {
    scr.onload = function() {
      uuCanvas.ready(function() {
        drawShape(document.getElementById('canvas'));
        drawShape(document.getElementById('vmlcanvas'));
      });
    };
  }

  scr.setAttribute("src", "../uupaa-excanvas.js");
  document.getElementsByTagName("head")[0].appendChild(scr);
}

function drawShape(canvas) {
  if (canvas.getContext) {

    // use getContext to use the canvas for drawing
    var ctx = canvas.getContext('2d');

    // Draw shapes
    ctx.fillRect(25,25,100,100);
    ctx.clearRect(45,45,60,60);
    ctx.strokeRect(50,50,50,50);

  } else {
    alert('You need Safari or Firefox 1.5+ to see this demo.');
  }
}
</pre>
    </div>
  </body>
</html>
